package org.apache.james.mime4j.parser;

import org.apache.james.mime4j.util.CharArrayBuffer;

public final class MimeEntityConfig
  implements Cloneable
{
  private long maxContentLen;
  private int maxHeaderCount;
  private int maxLineLen;
  private boolean maximalBodyDescriptor = false;
  private boolean strictParsing = false;

  public MimeEntityConfig()
  {
    this.maxLineLen = 1000;
    this.maxHeaderCount = 1000;
    this.maxContentLen = -1L;
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }

  public long getMaxContentLen()
  {
    return this.maxContentLen;
  }

  public int getMaxHeaderCount()
  {
    return this.maxHeaderCount;
  }

  public int getMaxLineLen()
  {
    return this.maxLineLen;
  }

  public boolean isMaximalBodyDescriptor()
  {
    return this.maximalBodyDescriptor;
  }

  public boolean isStrictParsing()
  {
    return this.strictParsing;
  }

  public void setMaxContentLen(long paramLong)
  {
    this.maxContentLen = paramLong;
  }

  public void setMaxHeaderCount(int paramInt)
  {
    this.maxHeaderCount = paramInt;
  }

  public void setMaxLineLen(int paramInt)
  {
    this.maxLineLen = paramInt;
  }

  public void setMaximalBodyDescriptor(boolean paramBoolean)
  {
    this.maximalBodyDescriptor = paramBoolean;
  }

  public void setStrictParsing(boolean paramBoolean)
  {
    this.strictParsing = paramBoolean;
  }

  public String toString()
  {
    CharArrayBuffer localCharArrayBuffer = new CharArrayBuffer(128);
    localCharArrayBuffer.append("[max body descriptor: ");
    localCharArrayBuffer.append(Boolean.toString(this.maximalBodyDescriptor));
    localCharArrayBuffer.append("][strict parsing: ");
    localCharArrayBuffer.append(Boolean.toString(this.strictParsing));
    localCharArrayBuffer.append("][max header length: ");
    localCharArrayBuffer.append(Integer.toString(this.maxLineLen));
    localCharArrayBuffer.append("]");
    return localCharArrayBuffer.toString();
  }
}